package engine.operators;

import engine.Operator;
import engine.Population;

public class CombineOperators<T> implements Operator<T> {

	private Operator<T>[] operators;

	public CombineOperators(Operator<T>... operators) {
		this.operators = operators;
	}

	@Override
	public Population<T> apply(Population<T> population) {
		Population<T> pop = population;
		for (Operator<T> op : operators) {
			pop = op.apply(pop);
		}
		return pop;
	}

}
